home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 71
/
MOBICLIC 71.ISO
/
mac
/
DATA
/
COMMUN
/
temp0001
/
00282_Script_GESTION_OBJET_DEPLACABLE_CONTRAINT
< prev
next >
Wrap
Text File
|
2004-12-05
|
2KB
|
62 lines
global gpiste_Tablo
property p_cettePiste, p_Nodepiste,p_nom_Acteur,p_xmin,p_xmax,p_ymin,p_ymax
property pX0,pY0,pX1,pY1
----------------------------------
on getPropertyDescriptionList me
return [#pX0:[#comment: "Xmin:",#format: #integer, #default: 0 ],\
#pY0:[#comment: "Ymin:",#format: #integer, #default: 0 ],\
#pX1:[#comment: "Xmax:",#format: #integer, #default: 0 ],\
#pY1:[#comment: "Ymax:",#format: #integer, #default: 0 ]]
end getPropertyDescriptionList
---------------------
on beginsprite me
p_Nodepiste = me.spriteNum
p_cettePiste = sprite(p_Nodepiste)
p_nom_Acteur = p_cettePiste.member.name
gpiste_Tablo = p_Nodepiste
demi_W = p_cettePiste.member.width/2
demi_H = p_cettePiste.member.height/2
p_xmin = pX1 - demi_W
p_ymin = pY1 - demi_H
p_xmax = pX0 +demi_W
p_ymax = pY0 +demi_H
end
-----------------------------------
on mouseWithin
if the pauseState = 1 then exit
if the mouseH < pX0 or the mouseH > pX1 or the mouseV < pY0 or the mouseV > pY1 then
cursor -1
exit
end if
cursor 260
end
---------------------------------
on mouseDown
if the pauseState = 1 then exit
if the mouseH < pX0 or the mouseH > pX1 or the mouseV < pY0 or the mouseV > pY1 then
cursor -1
exit
end if
cursor 290
deltaX = the mouseH - p_cettePiste.locH
deltaY = the mouseV - p_cettePiste.locV
repeat while the mouseDown
u = the mouseH
v = the mouseV
p_cettePiste.locH = min(p_xmax,max(p_xmin,u - deltaX))
p_cettePiste.locV = min(p_ymax,max(p_ymin,v - deltaY) )
updateStage
end repeat
end
--------------------------------
on mouseLeave
if the pauseState = 1 then exit
cursor -1
end
-----------------------------------
on mouseUp
if the pauseState = 1 then exit
cursor 260
end
-----------------------------------